package com.hh.bss.common;

public class TreeNode {
	public String id;
	public String text;
	public String parentId;
	public TreeChildren children = new TreeChildren();
	
	public String toString(){
		String result = "{"
				+"id: '" +id+ "'"
				+", text :" + text + "'";
		if(children !=null && children.getSize() !=0){
			result += ", children : "+ children.toString();
		} else {
			result += ", leaf : true";
		}
		
		return result + "}";
	}
	
	public void sortChildren(){
		if(children !=null && children.getSize() !=0){
			children.sortChildren();
		}
		
	}

}
